﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace Nathan_tools
{
    public partial class frm_pc_beep : Form
    {
        [DllImport ("kernel32.dll")]
        public static extern bool Beep(int frequency, int duration);

        public frm_pc_beep()
        {
            InitializeComponent();
        }

        private void frm_pc_beep_Load(object sender, EventArgs e)
        {

        }

        private void btn_beep_Click(object sender, EventArgs e)
        {
            Beep(Convert.ToInt16(textBox1.Text), Convert.ToInt16(textBox2.Text));
        }

        private void btn_longchangebeep_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 2000; i+=10)
            {
                Beep(i, 10);
            }
        }
    }
}
